﻿Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports NHibernate
Imports SIAVU.Dominio



Namespace Persistencia
    Public Class TelefonoPersistencia
        Public Function GetById(ByVal oTelefono As Telefono) As Telefono
            Dim session As ISession = NHibernateHelper.OpenSession
            oTelefono = DirectCast(session.Get(GetType(Telefono), oTelefono.TelefonoID), Telefono)
            'session.Close()
            Return oTelefono
        End Function

        Public Function GetByUsuarioId(ByVal UsuarioID As Long) As IList(Of Telefono)
            'Dim oTelefonos As IList(Of Telefono)
            'Dim session As ISession = NHibernateHelper.OpenSession
            'oTelefonos = session.CreateCriteria(GetType(Telefono)) _
            '.Add(Criterion.Expression.Eq("UsuarioID", UsuarioID)) _
            '.List(Of Telefono)()

            'Return oTelefonos
        End Function
    End Class
End Namespace

